﻿Shader "YY/PostProcess/YYCopyStd"
{
	Properties
	{
		_MainTex ("Texture", 2D) = "white" {}
	}
	CGINCLUDE
//#include "UnityCG.cginc"
//#include "Include/YYStdLib.cginc"
    struct Attributes
	{
		float4 vertex : POSITION;
		float2 texcoord : TEXCOORD0;
	};

	struct Varyings
	{
		float4 vertex : SV_POSITION;
		float2 texcoord : TEXCOORD0;
	};
	sampler2D _MainTex;
	float4 _MainTex_ST;

	Varyings Vert(Attributes v)
	{
		Varyings o;
		o.vertex = float4(v.vertex.xy * 2.0 - 1.0, 0.0, 1.0);
		o.texcoord = v.texcoord;

		#if UNITY_UV_STARTS_AT_TOP
		o.texcoord = o.texcoord * float2(1.0, -1.0) + float2(0.0, 1.0);
		#endif

		o.texcoord = o.texcoord * _MainTex_ST.xy + _MainTex_ST.zw; // We need this for VR

		return o;
	}

	float4 Frag(Varyings i) : SV_Target
	{
		float4 color = tex2D(_MainTex, i.texcoord);
		return color;
	}

	ENDCG
	SubShader
	{
		 Cull Off ZWrite Off ZTest Always

		Pass  // Copy
		{
			CGPROGRAM
			 #pragma vertex Vert
			 #pragma fragment Frag
			ENDCG
		}
	}
}
